#include <iostream>
#include <array>

class Entity{
public:
    static const int size = 5; 
    int example[size]; //编译期确定，需要size为static类型

    std::array<int, 6> another;

    Entity()
    {
        for(int i = 0; i < size; i++)
        {
            example[i] = 3;
        }
    }

};

//std::array传参 ，模板参数，当类被创建时，代码才会被写出来。
template<typename T,size_t l>
void printArray(std::array<T,l> a)
{
    for(auto& i : a)
        std::cout << i << std::endl;
}

int main()
{
     Entity e;
     std::string name = "caoxiansheng"; //const char*  (const char [13])"caoxiansheng"
     name += "hello";
     //std::string str = "cao" + "xiansheng"; //error 不能将两个const char数组相加，不能将两个指针相加， 他们不是真正的字符串
     std::cout << name << std::endl;

     //
     std::array<std::string, 4> colour{ "Blue", "Red", "Orange", "Yellow" };
     printArray(colour);

     std::array<std::string,3> cityarray;
     cityarray[0] = "Beijing";
     cityarray[1] = "Shanghai";
     cityarray[2] = "Heze";
     printArray(cityarray);

     const char* str1 = u8"caoxiansheng"; 
     const wchar_t* str2 = L"caoxiansheng";
     const char16_t* str3 = u"caoxinashneg";
     const char32_t* str4 = U"caoxiansheng";

}